From 5f25762122d54057b4c3aa33537c808cecae24f0 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 1 Oct 2012 19:34:25 -0400 Subject: [PATCH] admin: Install grub2 config file if we detect /etc/grub.d Decouple this from the kernel postinst one, since it's possible to have one but not the other. --- Makefile-ostree.am | 6 +++++- configure.ac | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile-ostree.am b/Makefile-ostree.am index 6b3b3b9b..0cd821d8 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -75,11 +75,15 @@ endif MANPAGES += doc/ostree.1 -if ENABLE_KERNEL_UPDATES +if ENABLE_GRUB2_HOOK grub2dir = $(sysconfdir)/grub.d grub2_SCRIPTS = src/ostree/grub2/15_ostree +endif + +if ENABLE_KERNEL_UPDATES + kernelpostinstdir = $(sysconfdir)/kernel/postinst.d kernelpostinst_SCRIPTS = src/ostree/kernel/15_ostree_update diff --git a/configure.ac b/configure.ac index 05d89061..b9577e65 100644 --- a/configure.ac +++ b/configure.ac @@ -112,7 +112,7 @@ AS_IF([ test x$with_libarchive != xno ], [ ], [ with_libarchive=no ]) AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no) -AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xno ], +AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xyes ], [kernel_updates_default=yes], [kernel_updates_default=no]) @@ -123,6 +123,16 @@ AC_ARG_ENABLE(kernel-updates, enable_kernel_updates=${kernel_updates_default}) AM_CONDITIONAL(ENABLE_KERNEL_UPDATES, test $enable_kernel_updates != no) +AS_IF([test x$cross_compiling != xyes && test -d /etc/grub.d && test x$enable_triggers_only != xyes ], + [grub2_hook_default=yes], + [grub2_hook_default=no]) + +AC_ARG_ENABLE(grub2-hook, + AS_HELP_STRING([--enable-grub2-hook], + [Install GRUB2 hook]), , + enable_grub2_hook=${grub2_hook_default}) +AM_CONDITIONAL(ENABLE_GRUB2_HOOK, test $enable_grub2_hook != no) + AC_CONFIG_FILES([ Makefile embedded-dependencies/Makefile @@ -140,4 +150,5 @@ echo " libarchive (parse tar files directly): $with_libarchive documentation: $enable_documentation kernel updates integration: $enable_kernel_updates + GRUB2 hook: $enable_grub2_hook " -- 2.30.2